import { ElMessage } from 'element-plus'

const Message: any = {
  success: '',
  warning: '',
  info: '',
  error: '',
}

const types = ['success', 'warning', 'info', 'error']

types.forEach(item => {
  Message[item] = (msg: string) => {
    return ElMessage({
      type: item as any,
      message: msg,
      duration: 2000
    })
  }
})

export default Message